<template>
  <div>
    <van-nav-bar title="地址" left-text="返回" left-arrow @click-left="onClickLeft" />
    <van-address-list
      v-model="chosenAddressId"
      :list="list"
      default-tag-text="默认"
      @add="onAdd"
      @edit="onEdit"
    />
  </div>
</template>

<script>
// import areaList from '../../text/areaList'
// import store from '../../vuex/store'
export default {
  name: 'Address',
  data () {
    return {
      chosenAddressId: 1,
      flag: false,
      list: [
        {
          // areaList: { ...areaList },
          id: '1',
          name: this.$store.userInfo.name,
          tel: this.$store.userInfo.tel,
          address: this.$store.userInfo.province + this.$store.userInfo.city + this.$store.userInfo.county + this.$store.userInfo.addressDetail
        }
      ]
    }
  },
  methods: {
    onAdd () {
      this.$router.push('/editAddress')
    },
    onEdit () {
      this.$router.push('/editAddress')
    },
    onClickLeft () {
      this.$router.go(-1)
      // this.$store.userInfo = 133
      // console.log(this.$store.userInfo)
    }
  }
}
</script>

<style lang="less" scope>
</style>
